﻿using System;
using System.Data;
using System.Web.UI;
using DevExpress.Web;
using System.Web.UI.WebControls;
using System.Drawing;

public partial class Du4Missing : MemberPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GridViewDataColumn gcImg = (GridViewDataColumn)gv.Columns["ProductId"];
        if (gcImg != null)
            gcImg.DataItemTemplate = new Utils.MissingPhotoColumnTemplate();


        GridViewDataColumn gcMissing = (GridViewDataColumn)gv.Columns["MissingQty"];
        if (gcMissing != null)
        {
            gcMissing.DataItemTemplate = new Utils.Du4MissingQtyTemplate();
            gcMissing.CellStyle.ForeColor = Color.Blue;
            gcMissing.CellStyle.Font.Underline = true;
            gcMissing.CellStyle.Cursor = "pointer";
        }

        ConfExpertMaster m = (ConfExpertMaster)Master;
        m.TableToExport = DataAccess.web2GetDU4Missing();
    }

    protected void grdMissingDetail_OnCustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
    {
        string parameter = e.Parameters;
        int Du4MissingId = int.Parse(parameter);

        DataTable dtMissingDetail = DataAccess.web2GetDU4MissingDetail(Du4MissingId);

        grdMissingDetail.DataSource = dtMissingDetail;
        grdMissingDetail.DataBind();
    }
    protected void gvDetail_BeforePerformDataSelect(object sender, EventArgs e)
    {
        Session["Du4MissingId"] = (sender as ASPxGridView).GetMasterRowKeyValue();
    }
}